package sv.com.seguros.dso.asg;

import java.util.HashMap;
import java.util.Map;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import sv.com.seguros.dso.BaseServiceImpl;
import sv.com.seguros.exception.WebException;

public class AsgContactoServiceImpl extends BaseServiceImpl implements AsgContactoService {

	@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = {Exception.class, WebException.class})
	public void deleteAsgContacto(Long asgContactoId) throws Exception{
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("asgContactoId", asgContactoId);
		String hqlQuery = "delete from AsgSeguimiento where asgContacto.asgContactoId = :asgContactoId)";
		executeNonHibernateQuery(hqlQuery, parameters);
		hqlQuery = "delete from AsgContacto where asgContactoId = :asgContactoId)";
		executeNonHibernateQuery(hqlQuery, parameters);
	}
}
